package com.example.zlloggingservice.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.zlloggingservice.entity.OperationLog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author zhenliu（孙凌岳）
 * @Description TODO
 * @Date 2025/6/19 15:11
 * @Version 1.0
 */
@Mapper
public interface OperationLogMapper extends BaseMapper<OperationLog> {
    @Select("SELECT * FROM operation_log WHERE user_id = #{userId} ORDER BY oper_time DESC LIMIT 5")
    List<OperationLog> selectRecentLogsByUserId(@Param("userId") Long userId);
}